//package OOday04;
//
//public class PolymorphicDemo {
//    public static void main(String[] args) {
//
////        Dog dog = new Dog("狗子",6,"蓝");
////        dog.color="S";
////        dog.eat();
////        dog.swim();
////        dog.lookHome();
////        Animal dog2 = new Dog("狗子",6,"蓝");
////        dog2.eat();
////        dog2.drink();
////        Swim dog3 = new Dog("狗子",6,"蓝");
////        dog3.swim();
////        Master.feed(dog2);
////        Master.feed(dog);
//
//        int [] ints = new  int[5];
//        char a = (char)ints[0];
//        Animal [] animals = new Animal[3];
//        animals [0] = new Dog("狗子",6,"蓝");
//        animals [1] = new Fish("鱼子",6,"蓝");
//        animals [2] = new Chicken("小黑子",6,"蓝");
//
//        for (int i= 0 ; i<3 ; i++){
//            if (animals[i] instanceof Dog)
//            {
//                Dog dog = (Dog) animals[i];
//                dog.lookHome();
//            }
//            if (animals[i] instanceof Swim){
//                Swim s1 = (Swim) animals[i];
//                s1.swim();
//            }
//            if (animals[i] instanceof Chicken){
//                Chicken c1 = (Chicken) animals[i];
//                c1.layEgg();
//            }
//
//
//        }
//    }
//
//
//
//}
//
